package com.design.strategy;

/**
 * @Author: ChengLei.Liu
 * @Date: 2020-07-23 14:26
 * @Description: 策略模式
 */
public class Test {

    public static void main(String[] args) {
        GoOnWorkStrategy goOnWorkByWeather = new GoOnWorkByWeather();
        GoOnWorkStrategy goOnWorkByPersonAge = new GoOnWorkByPersonAge();
        GoOnWork goOnWork = new GoOnWork();
        goOnWork.setWeather("秋天");
        Person person = new Person();
        person.setAge(26);
        person.setName("刘成磊");
        goOnWork.setPerson(person);
        goOnWork.goOnWork(goOnWorkByWeather);
        goOnWork.goOnWork(goOnWorkByPersonAge);
    }
}
